package com.gk.controller.api;

import com.eight.pojo.TbIntegrationHistory;
import com.eight.vo.ComResult;
import com.gk.service.TbIntegrationHistoryService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 积分使用记录控制层
 * @author: GK
 * @date: 2023/3/2 9:24
 * @version:No1.0
 */
@RestController
@RequestMapping("/customer/api/tbIntegrationHistory/")
public class TbIntegrationHistoryApi {

    @Resource
    private TbIntegrationHistoryService tbIntegrationHistoryService;

    /**
     * 条件分页查询
     * @param history 查询条件
     * @param currentPage 当前页
     * @param pageSize 页中数据数量
     * @return 响应前端
     */
    @PostMapping("/selectAll/{currentPage}/{pageSize}")
    public ComResult selectAll(@RequestBody TbIntegrationHistory history, @PathVariable Integer currentPage,@PathVariable Integer pageSize){
        System.out.println(history);
     return    tbIntegrationHistoryService.selectAll(history,currentPage,pageSize);
    }

    /**
     * 根据id进行删除数据
     * @param id id值
     * @return 响应前端
     */
    @PostMapping("deleteId/{id}")
    public ComResult deleteId(@PathVariable Integer id){
      return   tbIntegrationHistoryService.deleteId(id);
    }

}
